# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Jeff Bilyk <jbilyk at gmail>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-dbd-mysql
_pkgreal=DBD-mysql
pkgver=4.052
pkgrel=1
pkgdesc="Perl CPAN DBD::Mysql module"
url="https://metacpan.org/dist/DBD-mysql"
arch="all"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl perl-dbi"
makedepends="perl-dev mariadb-connector-c-dev zlib-dev perl-devel-checklib"
source="https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-$pkgver.tar.gz"
subpackages="$pkgname-doc"
options="!check" # requires a running dbms
builddir="$srcdir/$_pkgreal-$pkgver"

prepare() {
	default_prepare
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	make
}

check() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" -name perllocal.pod -delete
}

sha512sums="
7dd04209e656cc0221a757fa79bb979f4baf7834c2235b43754346792b416db7886df2907376b0c40f2def567d7c3ec153266ab5d57beb01f4eb2613a7467619  DBD-mysql-4.052.tar.gz
"
